home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: howland.reston.ans.net!torn!news!kima
- From: kima@uwindsor.ca (Sam Kim)
- Subject: Need to get value from 2-D matrix
- X-Nntp-Posting-Host: server.uwindsor.ca
- Message-ID: <DotDpo.6o2@news.uwindsor.ca>
- Sender: news@news.uwindsor.ca (Usenet)
- Organization: University of Windsor
- Date: Mon, 25 Mar 1996 08:17:48 GMT
-
-
- I'm writing a program that reads in a 2-D matrix from binary. I am
- useless with structures, so I'm trying to do this with arrays and
- pointers.
-
- Question : How do I read in the values?
-
- I have :
-
- for (i=0; i<n; i++)
- for (j=0; j<n; j++)
- {
- fread(&ptr,1,1,fp)
- matrix[i][j] = ptr;
- ptr++;
- }
-
- Shouldn't this work?
-
-